home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-10-04 | 11.2 KB | 292 lines | [TEXT/MPS ] |
- //--------------------------------------------------------------------------------------------------
- // TwistDownGlobals.r
- // ETO20 MacApp 3.3.1, MPW 3.4.1
- // Copyright © 1996 by Conrad Kopala
- // Twist Down Lists version 2.0a0 7/15/96
- //--------------------------------------------------------------------------------------------------
-
- #ifndef __TWISTDOWNGLOBALS__
- #define __TWISTDOWNGLOBALS__
-
- // My programs always include an AppGlobals.h file and an AppGlobals.r file.
- // The first part of the AppGlobals.h file parallels the AppGlobals.r file.
- // These two files define all command numbers, menu IDs, resource IDs, etc.
- // This approach to organizing program files arose out of development scenarios
- // involving multiple cooperative programs that share common files.
- // Consequently, I do not have to search through files to find them because
- // I know where they are. The risk of duplication and confusion is minimized.
- // For example, it is less likely with this approach that something like
- // kDefaultOKItemID will be defined more than once.
-
- //The following are also defined in TwistDownGlobals.h
- //----------------------------------------------------------------------------------------
- // Finder stuff
- //----------------------------------------------------------------------------------------
- #define kSignature 'TDL%' // Application signature
- #define kFileType 'disk' // Data file type
- #define kAETwistDownListsSuite 'TDL%' // AppleEvent class for TwistDownLists
- //----------------------------------------------------------------------------------------
- // AboutBoxIcon ID
- //----------------------------------------------------------------------------------------
- #define kAboutBoxIcon 2000
-
- //--------------------------------------------------------------------------------------------------
- // Menu IDs.
- //--------------------------------------------------------------------------------------------------
-
-
- #define mFormatMenu 4
- #define mControlMenu 5
- #define mWindowsMenu 6
- #if qDebug
- #define mTestMenu 7
- #endif
- #define mFontMenu 8
-
- //--------------------------------------------------------------------------------------------------
- // Command Numbers For Menu Items
- //--------------------------------------------------------------------------------------------------
-
- #define cExpandAll 1000 //menu command number
- #define cCollapseAll 1001 //menu command number
- #define cShowInvisibleFiles 1002 //menu command number
- #define cFailHere 1003 //menu command number
- #define cAllowUnlimitedDocs 1004 //menu command number
-
- #define cAppleEventRouting 1100 //menu command number for toggle between SendToDoc and SendToView
- #define cSendAppleEvents 1101 //menu command number
-
- #define cWritingDirection 1110 //menu command number for toggle between LeftToRight and RightToLeft
- #define cUseSystemDirection 1111 //menu command number
-
- #define cChangeWritingDirection 1112 //used as common command number for TChangeWritingDirectionCommand
-
- //Change Font commands
- #define cFont 1750 //Font menu item & is for hierarchical sub-menu
- #define cChangeFont 1751 //used as common command number for TChangeFontCommand
-
- /* Change Font-size commands */
- #define cLargerFontSize 1761 //menu command number
- #define cSmallerFontSize 1762 //menu command number
- #define cOtherFontSize 1763 //menu command number
-
- #define cChangeFontSize 1764 //used as common command number for TChangeFontSizeCommand
-
- #define cFontSizeBase 1800
- #define cFontSizeMin 1809
- #define cFontSizeMax 1896
-
- #if qDebug
- #define cCountObjects 1901 //menu command number
- #define cResetObjectCount 1902 //menu command number
- #define cPrintBaseClassInfo 1903 //menu command number
- #define cPrintMacAppClassInfo 1904 //menu command number
- #define cPrintAppClassInfo 1905 //menu command number
- #define cAppUserFlag1 1906 //menu command number
- #define cAppUserFlag2 1907 //menu command number
- #define cAppUserFlag3 1908 //menu command number
- #endif
-
- //--------------------------------------------------------------------------------------------------
- // Other Command Numbers - not for Menu Items
- //--------------------------------------------------------------------------------------------------
-
- #define cSplashScreen 1950
- #define cExpandElement 1951 //for TTwistDownElement::DoScriptCommand
- #define cCollapseElement 1952 //for TTwistDownElement::DoScriptCommand
- #define cSetSearchMethod 1953 //Required for TTwistDownDocument::GetSetPropertyInfo
-
- //--------------------------------------------------------------------------------------------------
- // AppleEvents for scripting support
- //--------------------------------------------------------------------------------------------------
- #define kTDLAEDispatchTable 1000 //aedt resource
-
- #define cTwistDownView 'TDvw' //AppleEvent class definition for the TTwistDownView
- #define cTwistDownElement 'TDel' //AppleEvent class definition for the TTwistDownElement
-
-
- #define kAETerminologyExtension 'aete'
-
- //AppleEvent event IDs
- #define kAEExpandAllID 'exAL' // cExpandAll
- #define kAECollapseAllID 'clAL' // cCollapseAll
- #define kAEExpandElementID 'exLI' // cExpandElement
- #define kAECollapseElementID 'clLI' // cCollapseElement
-
- #if qDebug
- #define kAEResetObjectCountID 'rsOC' // cResetObjectCount
- #endif
-
- //Writing direction enumerations
- #define enumWritingDirection 'WDir'
- #define kAELeftToRight 'ltRT'
- #define kAERightToLeft 'rtLT'
-
- //Search method for finding things in the list
- #define enumSearchMethod 'SMth'
- #define kAEVisibleList 'SVli'
- #define kAEWholeList 'SWli'
-
- //Apple Event routing
- #define enumAERouting 'EAEr'
- #define kAERouteToDoc 'RDoc'
- #define kAERouteToView 'RVew'
-
- //Properties of TTwistDownApp
- #define pShowInvisibleFiles 'SHin'
- #define pUseSystemDirection 'usSD'
- #define pSendAppleEvents 'snAE'
- #define pFailHere 'FlHr'
- #define pAERouting 'AERt'
- #define pUnlimitedDocs 'ULDs'
-
- #if qDebug
- #define pObjectCountingEnabled 'cObj'
- #define pPrBaseClassInfo 'prBC'
- #define pPrMacAppClassInfo 'prMA'
- #define pPrAppClassInfo 'prAp'
- #define pSetAppUserFlag1 'sUF1'
- #define pSetAppUserFlag2 'sUF2'
- #define pSetAppUserFlag3 'sUF3'
- #endif
-
- //Properties of TTwistDownDocument
- #define pNumFolders 'Nfld' // number of folders in the twist down list
- #define pNumFiles 'Nfil' // number of files in the twist down list
- #define pNumItems 'Nitm' // sum of number of folders and number of files in the twist down list
- #define pSearchMethod 'SMTH'
-
- //Properties of TTwistDownView
- #define pWritingDirection 'wDir'
- #define keyAEWritingDirection 'wDIR'
- #define pCouldExpand 'CDex' // fCouldExpand
- #define pCouldCollapse 'CDcl' // fCouldCollapse
- #define pFontName 'fntN'
-
- //Properties for TTwistDownElement
- #define pHasSubList 'hsSL'
- #define pShowSubList 'shSL'
- #define pHasControl 'hsCT'
- #define pItemInList 'liTM' //Absolute position in the list
- #define pIndentLevel 'INDT'
-
- //--------------------------------------------------------------------------------------------------
- // STR# resources except for BalloonHelp STR# resources
- //--------------------------------------------------------------------------------------------------
-
- #define kTwistDownTitles 1001
- #define kProgressDialogTitles 1002
- #define kProgressIndicatorOperationStrings 1003
- #define kMenuNameStrings 9999 //for toggled commands
-
- //----------------------------------------------------------------------------------------
- // Menu Items name indices for toggled commands
- //----------------------------------------------------------------------------------------
- #define kLeftToRightNameIdx 1
- #define kRightToLeftNameIdx 2
- #define kRouteToDocNameIdx 3
- #define kRouteToViewNameIdx 4
-
- resource 'STR#' (kMenuNameStrings,
- #if qNames
- "Menu Name Strings",
- #endif
- nonpurgeable) {
- {
- /* [1] */ "Left to Right",
- /* [2] */ "Right to Left",
- /* [3] */ "Route to Doc",
- /* [4] */ "Route to View",
- }
- };
- //--------------------------------------------------------------------------------------------------
- // 'View' resources
- //--------------------------------------------------------------------------------------------------
- #define kTwistDownViewID 'SYVW'
- #define kChangeFontSizeViewID 'SIZE'
- #define kSizeValueViewID 'fsvl'
- #define kProgressViewID 'prog'
- #define kProgressOperationViewID 'Oper'
- #define kProgressSubjectViewID 'Vol '
- #define kProgressBarViewID 'pBar'
- #define kAboutProgNameViewID 'pNam' //TStaticText ID for Program name in the about box
- #define kAboutCopyrightViewID 'cprt' //TStaticText ID for copyright in the about box
-
- #define kTwistDownControlViewID 'TDct' //Not really needed but useful when debugging
- //because it allows you to identify a twistDowncontrol.
-
- #define kAboutBoxWindowID 2000
- #define kTwistDownWindowID 2002
- #define kChangeFontSizeWindowID 2003
- #define kProgressWindowID 2004
-
-
- //--------------------------------------------------------------------------------------------------
- // BalloonHelp stuff
- //--------------------------------------------------------------------------------------------------
-
- #define kChangeFontSizeDialogHelp 3006
- #define kTwistDowncontrolHelp 3011
- #define kProgressDialogHelp 5001
-
- #define kAppIconHelpStrings 3000
- #define kTDLMenuHelpStrings 3001
- #define kFormatMenuHelpStrings 3002
- #define kFontMenuHelpStrings 3003
- #define kSizeMenuHelpStrings 3004
- #define kWindowsMenuHelpStrings 3005
- #define kChangeFontSizeDialogHelpStrings 3006
- #define kWritingDirectionHelpStrings 3007
- #define kControlMenuHelpStrings 3008
- #define kAppleEventsHelpStrings 3009
-
- #if qDebug
- #define kTestMenuHelpStrings 3010
- #endif
- #define kTwistDownControlHelpStrings 3011
- #define kProgressDialogHelpStrings 5001
-
-
- //--------------------------------------------------------------------------------------------------
- // Errors
- //--------------------------------------------------------------------------------------------------
- #define kErrorStrings 6001
- #define msgNotHFSVolume messageLookup + -26002
- #define errNotHFSVolume -26002
-
- #define msgAENotAFolder messageLookup + -26003
- #define errAENotAFolder -26003
-
- #define msgTooManyRows messageLookup + -26004
- #define errTooManyRows -26004
-
- #define msgCantExpandElement messageLookup + -26005
- #define errCantExpandElement -26005
-
- #define msgListAlreadyExpanded messageLookup + -26006
- #define errListAlreadyExpanded -26006
-
- #define msgListAlreadyCollapsed messageLookup + -26007
- #define errListAlreadyCollapsed -26007
-
- #define msgElementAlreadyExpanded messageLookup + -26008
- #define errElementAlreadyExpanded -26008
-
- #define msgElementAlreadyCollapsed messageLookup + -26009
- #define errElementAlreadyCollapsed -26009
-
- #define msgFailHere messageLookup + -26010
- #define errFailHere -26010
- //----------------------------------------------------------------------------------------
- // Other Constants
- //----------------------------------------------------------------------------------------
- #define kDefaultOKItemID 'ok '
- #define kCancelItemID 'cncl'
- #define kStopItemID 'stop'
-
-
- //End of items that are also defined in TwistDownGlobals.h
- // Byte values of hierarchical menu ids
- #define hmFontMenu "\0x08"
-
- #endif